from openai import OpenAI

client = OpenAI(
  base_url = "https://integrate.api.nvidia.com/v1",
  api_key = "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"
)

completion = client.chat.completions.create(
  model="deepseek-ai/deepseek-r1",
  messages=[
    {"role":"user",
     "content": "你作为AI专家，如何给小白普及Ai相关知识和最新热点消息，给出具体思路和内容"
     }],
  temperature=0.6,
  top_p=0.7,
  max_tokens=4096,
  stream=True
)

for chunk in completion:
  if chunk.choices[0].delta.content is not None:
    print(chunk.choices[0].delta.content, end="")

